package com.ruoyi.data.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.DataColumn;
import com.ruoyi.common.annotation.DataPermission;
import com.ruoyi.data.domain.DataClassification;
import com.ruoyi.data.domain.DataList;
import com.ruoyi.data.domain.bo.getData.GetDataClassificationBo;
import com.ruoyi.data.domain.bo.getData.GetDataDataListBo;
import com.ruoyi.data.domain.vo.DataListVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 数据列表Mapper接口
 *
 * @author ruoyi
 * @date 2023-10-26
 */
public interface DataListMapper extends BaseMapperPlus<DataListMapper, DataList, DataListVo> {

    @DataPermission({
        @DataColumn(key = "userName", value = "user_id")
    })
    Page<DataListVo> selectDataListVoPage(@Param("page") Page<Object> page, @Param(Constants.WRAPPER) QueryWrapper<DataList> wrapper);

    @DataPermission({
        @DataColumn(key = "userName", value = "user_id")
    })
    List<DataListVo> selectVoList(@Param(Constants.WRAPPER) LambdaQueryWrapper<DataList> wrapper);


    DataList getOneDataList(@Param("bo") GetDataDataListBo bo, @Param("userId")Long userId);


    int batchInsert(@Param("list") List<DataList> list);

}
